//
//  RegisteredView.m
//  TravelFirst
//
//  Created by lanou3g on 15/9/22.
//  Copyright (c) 2015年 吴娅君. All rights reserved.
//

#import "RegisteredView.h"

@implementation RegisteredView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        NSArray *arr1 = @[@"邮箱地址",@"密码",@"昵称"];
        NSArray *arr2 = @[@"请输入邮箱地址",@"请输入密码",@"请输入昵称"];
        for(int i = 0 ;i < 3; i++){
            UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(20, (i * 50) + 40, 80, 30)];
            lable.text = arr1[i];
            lable.textAlignment = NSTextAlignmentLeft;
            [self addSubview:lable];
            
            UITextField *field = [[UITextField alloc] initWithFrame:CGRectMake(kWidth - 200, (i * 50) + 40 , 180, 30)];
            field.placeholder = arr2[i];
            field.textAlignment = NSTextAlignmentRight;
            field.userInteractionEnabled = YES;
            field.font = [UIFont fontWithName:@"Arial" size:20.0f];
            field.tag = 100 + i;
            if(i == 1){
                //每输入一个字符就变成点 用语密码输入
                field.secureTextEntry = YES;
                field.keyboardType = UIKeyboardTypeDefault;
            }
            
            [self addSubview:field];
            
            UIView *line = [[UIView alloc] initWithFrame:CGRectMake(10, (i * 50) + 75, kWidth - 20, 1)];
            line.backgroundColor = [UIColor grayColor];
            [self addSubview:line];
        }
        
        UIButton *butt = [[UIButton alloc] initWithFrame:CGRectMake(15, 220, kWidth - 30, 40)];
        [butt setTitle:@"注册账号" forState:(UIControlStateNormal)];
        [butt setContentHorizontalAlignment:UIControlContentHorizontalAlignmentCenter];
        //设置边框
        [butt.layer setMasksToBounds:YES];
        [butt.layer setCornerRadius:8.0];
        [butt.layer setBorderWidth:1.0];
        [butt.layer setBorderColor:[[UIColor blueColor] CGColor]];
        [butt setTitleColor:[UIColor blueColor] forState:(UIControlStateNormal)];
        butt.tag = 500;
        [self addSubview:butt];
    }
    return self;
}

@end
